# -*- coding:utf-8 -*-

#需要先运行的函数
import os,sys
project_dir_path=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))  #项目路径
sys.path.append(project_dir_path)           #将项目路径添加到环境中   使得python可以导包
from queue_dir.client_queue import *        #导包
class queue_client_class:
    def __init__(self):
        self.connect_queue_db_send_web=connect_queue_db_send_web()
        self.connect_queue_web_send_db=connect_queue_web_send_db()

        self.dct={}
        self.dct['db_send_web']=self.connect_queue_db_send_web
        self.dct['web_send_db']=self.connect_queue_web_send_db

    def put(self,name='db_send_web'):
        for i in range(5):
            val={'3':444}
            self.dct[name].put(val)
            print('put ',name,val)
    def get(self,name='db_send_web'):
        while 1:
            if self.dct[name].qsize() > 0:
                val=self.dct[name]
                print('get ',name,val)
            else:
                break
if __name__=='__main__':
    queue_main=queue_client_class()
    queue_main.put('db_send_web')
    # queue_main.get('db_send_web')
